//
//  ideaTwo.m
//  EquiriesProject
//
//  Created by qianfeng on 15/11/1.
//  Copyright (c) 2015年 HXH. All rights reserved.
//

#import "ideaTwo.h"

@implementation ideaTwo
{
    UIScrollView * _scroller;
}

-(instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = [UIColor colorWithRed:0.9 green:0.9 blue:0.9 alpha:1];
        [self createScroller];
        [self createButton];
    }
    return self;
}

//创建scrollerView
-(void)createScroller
{
    _scroller = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, Width, Height)];
    _scroller.backgroundColor = [UIColor colorWithRed:0.9 green:0.9 blue:0.9 alpha:1];
    _scroller.contentSize = CGSizeMake(Width, Height+40);
    _scroller.delegate = self;
    [self addSubview:_scroller];
    
}


-(void)createButton
{
    UIButton * button = [[UIButton alloc]init];
    [button setTitle:@"还未获取数据哦" forState:UIControlStateNormal];
    [_scroller addSubview:button];
    
    [button mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.mas_top).offset(200);
        make.left.equalTo(self.mas_left).offset(50);
        make.right.equalTo(self.mas_right).offset(-50);
        make.height.equalTo(@60);
    }];
}

@end
